let system = uni.getSystemInfoSync()

export const getStatusBarHeight = () => system.statusBarHeight || 15

export const getTitleBarHeight = () => {
	if (uni.getMenuButtonBoundingClientRect) {
		let {
			top,
			height
		} = uni.getMenuButtonBoundingClientRect()
		return height + (top - getStatusBarHeight().value) * 2
	} else {
		return 44
	}
}

export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight()

// export const getLeftIcon = () => {
// 	if (tt.getCustomButtonBoundingClientRect) {
// 		let (leftIcon: {
// 			left,
// 			width
// 		}) = tt.getCustomButtonBoundingClientRect()
// 		return left + parseInt(width)
// 	} else {
// 		return 0
// 	}
// }